<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // var arr = ['aa', 'bb', 'cc', '', 1, 0, '1', 1, 'bb', null, undefined, null];
        var arr = ['a', 'b', 'c', 'a'];

        function sele(arr) {
            var temp = [];
            for (var i = 0; i < arr.length; i++) {
                for (var j = i + 1; j < arr.length; j++) {
                    if (arr[i] === arr[j]) {
                        j = ++i;
                    }
                }
                temp.push(arr[i]);
            }
            return temp;
        }
        var arr1 = sele(arr);
        console.log(arr1);
    </script>
</body>

</html>